package May;

import java.nio.file.Watchable;
import java.util.Scanner;

public class DAY0518 {
    //最近公共祖先
    public int getLCA(int a, int b) {
        // write code here
        while (a != b){
            if (a > b){
                a /= 2;
            }else {
                b /= 2;
            }
        }
        return a;
    }
    public static void main(String[] args) {
        //求最大连续bit数
        //接收数据
        Scanner str = new Scanner(System.in);
        while (str.hasNext()){
            int n = str.nextInt();
            //将接收到的int类型数字转换为二进制
            String nums = Integer.toBinaryString(n);
            String[] str1 = nums.split("0");
            int maxNums = 0;
            for (String v :str1){
                if (v.length()>maxNums){
                    maxNums = v.length();
                }
            }System.out.println(maxNums);
        }
        System.out.println(getValue(2));
    }

    public static int getValue(int i){
        int result = 0;
        switch (i){
            case 1:
                result = result+i;
            case 2:
                result = result+i*2;
            case 3:
                result=result+i*3;
        }
        return result;
    }

}
